<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-bind的使用</title>

  <style>
    .activate{color:yellow}
  </style>
</head>
<body>


<div id="app">
  <h1 class="title" :class="get_class()">{{message}}</h1>
  <button v-on:click="btnclick">控制class</button>
</div>

<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el:"#app",
    data: {
      message:"stupid mother fucker",
      isactivate:true,
      isline:false,
    },
    methods:{
      btnclick:function (){
        this.isactivate=!this.isactivate
      },

      get_class:function (){
        return {activate:this.isactivate,line:this.isline}
      }
    }
  })



</script>

</body>
</html>